\section{Introduction}
\label{sec:introduction}

The task for this assignment was to control I/O-devices, more specificly the LEDs and buttons, on the STK1000 development board with the AVR32-microcontroller AT32AP7000. One of the eight LEDs should be turned on and the position of the light should be adjusted by pressing button 0 (right) or 2 (left). To fulfill these requirements a program had to be written in AVR32 assembler. As proposed in the assignment text a first step was implemented where the state of the I/O-devices were constantly read by the program's main loop. When this worked a second iteration was implemented with the usage of interrupts. 

One of the biggest challenges in the beginning was to get to know the AVR32 instruction set an to learn how to use its documentation, because it is very important to know the exact behavior of a particular instruction.

The following sections will present the solution and the result of this assignment. The first step of the solution (without interrupts) applies, after a necessary set-up of I/O-devices, a loop in which the concerning registers are read infinitely in order to get the current status of the buttons. According to that status and the number of the lightened LED the light position is changed. The more advanced version with interrupts has a similar set-up in the beginning, but the main loop is empty, i.e. the program waits there for interrupts from the buttons. A key problem with interrupts from buttons is to get only one defined interrupt each time a buttons is pressed, and not several due to contact bouncing \cite{kompendium}. The program is also to only react when a button is pressed down, and not when it is released. Details about how that was solved follows in Section \ref{subsec:genappr}.